package com.cy.train.common.util;

import cn.hutool.core.util.IdUtil;

/**
 * @Description: 封装hutool雪花算法
 * @Date: 2024/2/26 10:35
 * @Author: cyzhang
 */
public class SnowUtil {
    private static final long dataCenterId = 1;
    private static final long workerId = 1;

    public static long getSnowflakeNextId() {
        return IdUtil.getSnowflake(workerId, dataCenterId).nextId();
    }

    public static String getSnowflakeNextIdStr() {
        return IdUtil.getSnowflake(workerId, dataCenterId).nextIdStr();
    }
}
